Skip to content

JdbcAggregateTemplate honors columns specified in query #1967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from

Conversation

schauder
Copy link
Contributor

@schauder schauder commented Jan 2, 2025

If no columns are given, all columns are selected by default.

If columns are specified, only these are selected.
Joins normally triggered by columns from 1:1 relationships are not implemented, and the corresponding columns don't get loaded and can't be specified in a query.

Limiting columns is not supported for single query loading.

Closes #1803

@schauder schauder requested a review from mp911de January 2, 2025 13:33
@schauder schauder force-pushed the issue/1803-projection branch from 155004e to cbde1e7 Compare January 15, 2025 13:55
@mp911de mp911de added this to the 3.5 M1 (2025.0.0) milestone Jan 16, 2025
Copy link
Member

@mp911de mp911de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mapping is missing in case a property uses a renamed column, see SqlGeneratorUnitTests.DummyEntity.id and the updated test selectByQueryWithColumnLimit.

schauder added a commit that referenced this pull request Jan 20, 2025
Query columns now get checked against property names.
If such a property name is found, the property is used.
Otherwise the column is considered a literal column and used as is in the SQL generation.

Original pull request #1967
See #1803
@mp911de mp911de self-assigned this Jan 30, 2025
@mp911de mp911de force-pushed the main branch 2 times, most recently from 571fd96 to 1f2e694 Compare April 9, 2025 13:29
@schauder schauder assigned schauder and unassigned mp911de May 26, 2025
schauder added a commit that referenced this pull request May 26, 2025
Query columns now get checked against property names.
If such a property name is found, the property is used.
Otherwise the column is considered a literal column and used as is in the SQL generation.

Original pull request #1967
See #1803
@schauder schauder force-pushed the issue/1803-projection branch from 2326e23 to 09d2d28 Compare May 26, 2025 12:40
@schauder schauder assigned mp911de and unassigned schauder May 27, 2025
@mp911de mp911de added the type: enhancement A general enhancement label Jun 11, 2025
schauder and others added 6 commits June 11, 2025 15:21
If no columns are given, all columns are selected by default.

If columns are specified, only these are selected.
Joins normally triggered by columns from 1:1 relationships are not implemented, and the corresponding columns don't get loaded and can't be specified in a query.

Limiting columns is not supported for single query loading.

Closes #1803
Extract method. Extend tests. Introduce empty Query object to avoid nullability.
Query columns now get checked against property names.
If such a property name is found, the property is used.
Otherwise the column is considered a literal column and used as is in the SQL generation.

Original pull request #1967
See #1803
Resolve mapped property paths to aggregate paths. Add tests.
@mp911de mp911de force-pushed the issue/1803-projection branch from 09d2d28 to 80c113a Compare June 11, 2025 13:21
When fields from referenced entities got requested, ther intermediate necessary joins were not included.
@mp911de mp911de added type: bug A general bug and removed type: enhancement A general enhancement labels Jun 13, 2025
mp911de pushed a commit that referenced this pull request Jun 13, 2025
If no columns are given, all columns are selected by default.

If columns are specified, only these are selected.
Joins normally triggered by columns from 1:1 relationships are not implemented, and the corresponding columns don't get loaded and can't be specified in a query.

Limiting columns is not supported for single query loading.

Closes #1803
Original pull request: #1967
mp911de added a commit that referenced this pull request Jun 13, 2025
Resolve mapped property paths to aggregate paths. Add tests.
Clean up unused profile declarations.

See #1803
Original pull request: #1967
mp911de pushed a commit that referenced this pull request Jun 13, 2025
If no columns are given, all columns are selected by default.

If columns are specified, only these are selected.
Joins normally triggered by columns from 1:1 relationships are not implemented, and the corresponding columns don't get loaded and can't be specified in a query.

Limiting columns is not supported for single query loading.

Closes #1803
Original pull request: #1967
mp911de added a commit that referenced this pull request Jun 13, 2025
Resolve mapped property paths to aggregate paths. Add tests.
Clean up unused profile declarations.

See #1803
Original pull request: #1967
@mp911de mp911de closed this Jun 13, 2025
@mp911de
Copy link
Member

mp911de commented Jun 13, 2025

That's merged, polished, and backported now.

@mp911de mp911de deleted the issue/1803-projection branch June 13, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JdbcAggregateOperations does not use columns parameter of Query
2 participants